A RAM can hold information including multiple pieces of program code or data fragments. Typically each byte of RAM is accessible using a unique address. During program execution, one or different code fragments can be stored in the same RAM location. Which code fragment is currently present might be determined by the program itself or depend on some other condition. While debugging the program, breakpoints can be set in the code. A breakpoint is an intentional stopping, pausing place, or interruption in a program, to aid in debugging the program. During the pause, after a breakpoint is reached, a programmer can inspect the test environment (logs, memory, files, etc.) to determine whether the program is functioning as expected. When a breakpoint is set at a certain address in the RAM, once that breakpoint is reached, one does not know necessarily what program code just executed if more than one code fragment can be sharing the same RAM address. A program is held in RAM can be exchanged dynamically by an operating system memory management unit (MMU) or explicitly by a user program. For this purpose the microprocessor can be provided with an internal scratch pad RAM.
Typically a breakpoint logic is implemented as a comparator, working on a fetch address emitted by the processor. If the fetch address is not unique in the context considered here, a link to the currently executed code fragment is missing and false triggers may occur that must be ignored. This problem exists both for physical and virtual addresses. This affects the runtime behavior up to the first “real” breakpoint.
One solution for dealing with this problem is to halt the system and read the program RAM content. However, this solution is not applicable if the target cannot be stopped or the RAM content is swapped repeatedly. Furthermore, it's inefficient for analyzing longer traces.
Another solution is to track RAM loading. That is accomplished by tracing or remembering the content of a specific “marker” location. This approach fails when the number of RAM fragments written independently (“heap” of modern operating system) grows or when the marker location cannot be forced to be served by the tool chain (e.g., compiler, linker, locator, loader, etc.). Additionally, this method requires extra logic and synchronization to track the loading if it is not done by the processor itself but, for example, by a DMA controller.